Apple II
Technical Notes
_____________________________________________________________________________
                                                  Developer Technical Support


Apple IIc
#2:    40-Column and Double High-Resolution Graphics

Revised by:    Matt Deatherage                                  November 1988
Revised by:    Cameron Birse                                    February 1986

This Technical Note describes how to properly handle the 40-column screen 
while using double high-resolution graphics on the Apple IIc.
_____________________________________________________________________________

Many developers using double high-resolution  graphics may wish to use 40-
column text displays so that the text can be read on a television set.  There 
are a couple of possibilities for accomplishing this task:

1.    You can define your own double high-resolution character set with 
      any size characters you desire, then plot them on the double high-
      resolution screen.
2.    You can print text to the Apple IIc text screen and toggle the 
      screen on to display it.

Note:    There is no way to display 4 lines of 40-column text at the 
bottom of the double high-resolution screen in mixed mode since 
the 80 column hardware must be active while double high-resolution 
mode is being used.

Using the second method outlined above requires some special considerations.

The Apple IIc scroll routine continues to use the window parameters when 
scrolling, but uses the 80COL softswitch to determine if it should scroll the 
80-column screen or 40-column screen.  Since the firmware has initialized a 
40-column window, the scroll routines will move only the first 40 columns, but 
the 80COL flag has been turned on for double high-resolution.  Because of the 
80COL flag, the scroll routine takes every even column from auxiliary memory 
and every odd column from main memory.  As a result, only the first 40 columns 
get scrolled, 20 columns from auxiliary memory and 20 columns from main 
memory.

One solution to the problem is writing your own scroll routines, while another 
is writing to the screen so scrolling is not necessary.  There is, however, 
another solution.  Turn on the full 80-column mode with PR#3 or equivalent.  
Now print your text to COUT in the normal manner, and do not exceed 40 
characters per line--the 80-column firmware should scroll everything properly.  
When you are ready to display text, send a Control-Q sequence through COUT to 
toggle to 40-columns and send a Control-R sequence to return to double high-
resolution mode.  These control characters toggle the display modes, but leave 
the 80-column firmware active.

When switching between modes, you may experience a momentary glitch.  If you 
send the Control-Q sequence to COUT while still in graphics mode, the screen 
will first switch to the normal high-resolution mode before finally switching 
to text mode.  If you switch to text mode first, the text will be in 80-column 
mode (with 40 columns displayed on the left of the screen) before ultimately 
switching to 40-column mode).  This same potential glitch may occur when 
switching back to double high-resolution mode, and it may be only momentary 
and not present any problems for your application.  If, however, it does 
present a problem, you may wish to make your switch coincide with the video's 
vertical blanking interval (see the Apple IIc Technical Reference Manual).


Further Reference
o    Apple IIc Technical Reference Manual

